﻿@{
    ViewBag.Title = "表单页面";
    Layout = "~/Views/Shared/_FormWhite.cshtml";
    List<YiSha.Entity.YiDongYuan.RegionReportEntity> region = ViewBag.Region;
}
<script type="text/javascript">
    $(function () {
        laydate.render({ elem: '#startDate', format: 'yyyy-MM-dd HH:mm:ss' });
        laydate.render({ elem: '#endDate', format: 'yyyy-MM-dd HH:mm:ss' });
    })
    function btnExport() {
        var startDate = $("#startDate").val(), endDate = $("#endDate").val(), region = $("#region").val();
        if (!startDate || !endDate) {
            alert("请输入导出日期");
            return;
        }
        var url = '@Url.Content("~/YiDongYuan/DetectionExport/ExportDetectionJson")';
        var postData = {
            StartDate: startDate,
            EndDate: endDate,
            Region: region
        };
        ys.exportExcel(url, postData);
    }
</script>
<div style="margin: 20px;">
    <div style="width:100%;text-align:left;margin:10px 50px;">
        <h2>数据导出</h2>
    </div>
    <table class="form" border="1" style="width:824px;">
        <tr>
            <td colspan="4" style="text-align:center;line-height:40px;font-size:14px;font-weight:bold;">
                导出检测数据
            </td>
        </tr>
        <tr>
            <td class="formTitle">所属县区<font face="宋体">*</font></td>
            <td class="formValue" colspan="4">
                <select name="region " class="form-control" id="region">
                    @foreach (var item in region)
                    {
                        <option value="@item.RegionName">@item.RegionName</option>
                    }
                </select>
            </td>
        </tr>
        <tr>
            <td class="formTitle">开始日期<font face="宋体">*</font></td>
            <td class="formValue" colspan="3">
                <input type="datetime" name="startDate" class="form-control"
                       id="startDate" value="@(new DateTime(DateTime.Now.Year,DateTime.Now.Month,1).ToString("yyyy-MM-dd 00:00:00"))" />
            </td>
        </tr>
        <tr>
            <td class="formTitle">结束日期<font face="宋体">*</font></td>
            <td class="formValue" colspan="3">
                <input type="datetime" name="endDate" class="form-control input-wdatepicker" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                       id="endDate" value="@(new DateTime(DateTime.Now.Year,DateTime.Now.Month,1).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"))" />
            </td>
        </tr>
        <tr>
            <td class="formTitle"></td>
            <td class="formValue" colspan="3">
                <input type="button" class="btn btn-primary" value="导出数据" onclick="btnExport()" />
            </td>
        </tr>
    </table>
    @* <table class="form" border="1" style="max-width:1024px;margin-top:10px;">
            <tr>
                <td colspan="4" style="text-align:center;line-height:40px;font-size:14px;font-weight:bold;">
                    导出备案数据
                </td>
            </tr>
            <tr>
                <td class="formTitle">所属县区<font face="宋体">*</font></td>
                <td class="formValue" colspan="3">
                    <select name="region " class="form-control" id="bgRegion">
                        @foreach (var item in region)
                        {
                            <option value="@item.ItemName">@item.ItemName</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td class="formTitle">开始日期<font face="宋体">*</font></td>
                <td class="formValue" colspan="3">
                    <input type="datetime" name="baStartDate" class="form-control input-wdatepicker" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                           id="baStartDate" value="@(new DateTime(DateTime.Now.Year,DateTime.Now.Month,1).ToString("yyyy-MM-dd 00:00:00"))" />
                </td>
            </tr>
            <tr>
                <td class="formTitle">结束日期<font face="宋体">*</font></td>
                <td class="formValue" colspan="3">
                    <input type="datetime" name="baEndDate" class="form-control input-wdatepicker" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                           id="baEndDate" value="@(new DateTime(DateTime.Now.Year,DateTime.Now.Month,1).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd 23:59:59"))" />
                </td>
            </tr>
            <tr>
                <td class="formTitle"></td>
                <td class="formValue" colspan="3">
                    <input type="button" class="btn btn-primary" value="导出数据" onclick="btnBeiAnExport()" />
                </td>
            </tr>
        </table> *@
</div>